package com.taptech.doufu.ui.activity.base

import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.WindowManager
import com.taptech.doufu.presenter.BasePresenter
import com.taptech.doufu.util.SmartBarUtils
import com.taptech.doufu.weex.statusbar.StatusBarCompat

abstract class BaseMvpActivity<P:BasePresenter<*>> : DiaobaoBaseActivity(){

    protected lateinit var mPresenter: P


    protected abstract fun initPresenter(intent:Intent)

    protected abstract fun initView()

    protected abstract fun getLayout():Int

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getLayout())
        initPresenter(intent)
        checkPresenterIsNull()
        initView()
    }

    private fun checkPresenterIsNull() {
        if (mPresenter == null) {
            throw IllegalStateException("please init mPresenter in initPresenter() method ")
        }
    }



}